<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
</head>
<body>
    <a>我是a标签1</a>
    <a>我是a标签2</a>
    <a>我是a标签3</a>
    <a>我是a标签4</a>
    <a>我是a标签5</a>
    <a>我是a标签6</a>
    <button onclick="jqRemove()">jq删除</button>
    <button onclick="jsRemove()">原生js删除</button>
</body>
<script>
    //删除所有的a标签
    const jqRemove = () =>{
        $('a').remove();
    }
    
    //删除所有的a标签
    const jsRemove = () =>{
        var allA = document.getElementsByTagName('a');
        for(var i = 0;i<allA.length;i++){
            allA[i].remove();
            i--;
        }
    }
   
</script>
</html>